<?php
/**
 * [PHPFOX_HEADER]
 */

defined('PHPFOX') or exit('NO DICE!');

/**
 *
 *
 * @copyright		[PHPFOX_COPYRIGHT]
 * @author  		Raymond Benc
 * @package  		Module_Feed
 * @version 		$Id: display.class.php 4621 2012-09-12 05:34:34Z Raymond_Benc $
 */
class Survey_Component_Block_Display extends Phpfox_Component
{
	/**
	 * Class process method wnich is used to execute this component.
	 */
	public function process()
	{
		$iPage = $this->request()->get('page',1);
		list($iCnt, $aSurveys) = PHPFOX::getService("survey.browse")->get($iPage,10);
                Phpfox::getLib('pager')->set(array('page' => $iPage, 'size' => 10, 'count' => $iCnt, 'ajax' => 'survey.viewMore'));
                $this->template()->assign(array(
				'iCnt' => $iCnt,
				'aItems' => $aSurveys,
			)
		);
		return 'block';
	}

	public function clean()
	{
		$this->template()->clean(array(
				'sHeader',
				'aFeeds',
				'sBoxJsId'
			)
		);
	}
}

?>